#include "webview.h"

WebView::WebView(QWidget* parent) : QWebEngineView(parent) { }

WebView::WebView(CreateWindowFunction f, QWidget* parent) : QWebEngineView(parent), callback_(f) { }

QWebEngineView* WebView::createWindow(QWebEnginePage::WebWindowType type)
{
    if (callback_) {
        return callback_(type);
    }
    return QWebEngineView::createWindow(type);
}
